import request from '@/utils/request'

// 获取部门列表
export const getDeparmentsListApi = () => {
  return request.get('/company/department')
}

// 删除成员
export const delDepartmentsApi = (id) => {
  return request.delete(`/company/department/${id}`)
}

// 获取部门负责人列表
export const getUserSimpleListApi = () => {
  return request.get('/sys/user/simple')
}

export const addDepartmentApi = form => {
  return request.post('/company/department', form)
}

/* export const addDepartmentApi = form => {
  return request({
    url: '/company/department',
    method: 'post',
    data: form
  })
} */

export const getDepartmentDetailApi = (id) => {
  return request(`/company/department/${id}`)
}

// export const getDepartmentDetailApi = id => {
//   return request({
//     url: `/company/department/${id}`
//   })
// }

// 修改部门
export const editDepartmentApi = data => {
  return request({
    url: `/company/department/${data.id}`,
    method: 'put',
    data
  })
}

